package com.vrms.app.service.impl;

import com.vrms.app.dao.BedDao;
import com.vrms.app.entity.Bed;
import com.vrms.app.service.BedService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BedServiceImpl implements BedService {
    @Resource
    private BedDao bedDao;

    @Override
    public List<Bed> listPage(int page, int size, String bedInfo) {
        return bedDao.listPage((page-1)*size,size,bedInfo);
    }

    @Override
    public int count(String bedInfo) {
        return bedDao.count(bedInfo);
    }

    @Override
    public boolean save(Bed bed) {
        return bedDao.save(bed)>0;
    }

    @Override
    public boolean update(Bed bed) {
        return bedDao.update(bed)>0;
    }

    @Override
    public boolean remove(int id) {
        return bedDao.remove(id)>0;
    }

    @Override
    public List<Bed> list() {
        return bedDao.list();
    }
}
